class CreateLogLeadsHistories < ActiveRecord::Migration[5.1]
  def change
    create_table :log_leads_histories do |t|
      t.integer :firm_id, comment: '相关公司'
      t.integer :leads_type, comment: '跟进类型'
      t.integer :from_user_id, comment: '原跟进人'
      t.integer :to_user_id, comment: '获取人'
      t.datetime :that_begin_at, comment: '跟进开始时间'
      t.datetime :that_expire_at, comment: '跟进结束时间'
      t.integer :that_stage, comment: '跟进状态'
      t.integer :created_by, comment: '操作人'

      t.timestamps
    end
    add_index :log_leads_histories, :firm_id
    add_index :log_leads_histories, :leads_type
  end
end
